package practice.a6.b1.c3;

import java.util.Arrays;

/**
 * 命令式和申明式比较
 * @author yuan
 */
public class Main {
    static int[] a = {1, 3, 4, 5, 6, 9, 8, 7, 4, 2};
    static void imperative() {
        for (int i = 0; i < a.length; i++) {
            System.out.println(a[i]);
        }
    }
    static void declarative() {
        Arrays.stream(a).forEach(System.out::println);
    }
    public static void main(String[] args) {
        imperative();
        declarative();
    }
}
